package me.fengzhuan.demo;

public class GameTest {
    public static void main(String[] args) {
        //创建角色
        Role r1 = new Role("乔峰", 100, '男');
        Role r2 = new Role("鸠摩智", 100, '男');

//展示角色
        r1.show();
        r2.show();
//开始格斗  回合制游戏
        while (true) {

            //r1攻击r2
            r1.attack(r2);
            if (r2.getBlood() == 0) {
                System.out.println(r1.getName() + "赢了");
                break;
            }
            //r2攻击r1
            r2.attack(r1);
            if (r1.getBlood() == 0) {
                System.out.println(r2.getName() + "赢了");
                break;
            }
        }
    }
}
